package site.edody.dframe.ssoclient;

import cn.dev33.satoken.sso.processor.SaSsoClientProcessor;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.slf4j.Logger;

/**
 * SSO 客户端接口
 */
@RestController
public class SSoClientController {


    private final Logger log = LoggerFactory.getLogger(SSoClientController.class);


    // 登录
    @RequestMapping("/sso/login")
    public Object ssoAuth() {
        log.info("**********调用客户端 login ");
        return SaSsoClientProcessor.instance.ssoLogin();
    }

    // SSO-Server：RestAPI 登录接口
    @RequestMapping("/sso/logout")
    public Object ssoDoLogin() {
        log.info("**********调用客户端 logout ");
        return SaSsoClientProcessor.instance.ssoLogout();
    }

    // SSO-Server：校验ticket 获取账号id
    @RequestMapping("/sso/logoutCall")
    public Object ssoCheckTicket() {
        log.info("**********调用客户端 logoutCall ");

        return SaSsoClientProcessor.instance.ssoLogoutCall();
    }


}
